package com.igrowing.easyRpc.exception;

import com.igrowing.easyRpc.error.ErrorCode;

public class RpcException extends RuntimeException{

    private int code;

    public RpcException(int code, String message) {
        super(message);
        this.code = code;
    }

    public RpcException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public RpcException(ErrorCode errorCode, String message) {
        super(message);
        this.code = errorCode.getCode();
    }

    public int getCode() {
        return code;
    }

}
